package com.chwl.framework.springboot.grpc.config;

import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;

/**
 * <p>功能:</p>
 *
 * @date:2018-07-14 下午6:50<br/>
 * @version:1.0 <br/>
 */
public class ClassPathGrpcServiceScanner extends ClassPathBeanDefinitionScanner {

    ClassPathGrpcServiceScanner(BeanDefinitionRegistry registry) {
        super(registry, false);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition) {
        return beanDefinition.getMetadata().isInterface() && beanDefinition.getMetadata().isIndependent();
    }

}